﻿@{
    ViewBag.Title = "Home Page";
}

<div class="jumbotron">
    <h1>ASP.NET</h1>
    <p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
    <p><a href="http://asp.net" class="btn btn-primary btn-large">Learn more &raquo;</a></p>
</div>
<script type="text/javascript">

    function HomeIndexCtrl($scope, $http) {
        $http.get("/api/Field").success(function (data) {
            $scope.fields = data;
        }).error(function (header, status, data, config) {
            window.alert("Problem u komunikaciji!");
        });
    }

</script>
<div class="row">
    <div ng-controller="HomeIndexCtrl">
        <ul>
            <li ng-repeat="field in fields"><a href="/home/field/{{field.FieldId}}"> {{field.FieldName}} </a> {{field.FieldId}}</li>
        </ul>
    </div>
</div>